<script lang="ts" setup>
	import { reactive, ref } from "vue";
	import {
		getCurrentInstance
	} from 'vue'
	import {
		useRouter
	} from 'uni-mini-router'
	import {
		onShow,
		onHide,
		onLoad,
		onReachBottom
	} from '@dcloudio/uni-app'
	import {
		userStore
	} from '@/pinia';
	const userStoreInfo = userStore();
	const {
		proxy,
	} = getCurrentInstance()
	const userRole = userStoreInfo.userFlag
	// console.log(userStoreInfo.userFlag);
	let router = useRouter()
	const routerLink = (e) => {
		router.push({
			name: e
		})
	}
	let zongshu = ref();
	(() => {
		proxy.$req('GET', proxy.$api.bzjTongji, {}).then((res) => {
			console.log(res);
			zongshu.value = res.result
		})
	})();
	onShow(() => {
		userStoreInfo.updateUserInfo(userStoreInfo.userInfo.id)
	})
</script>
<template>
	<view class="container">
		<view class="maTop" @click="routerLink('editStoreInfo')">
			<view class="mal">
				<image :src="userStoreInfo.userInfo.supplier.storeImage || '../../../static/logo.png'" mode="">
				</image>
			</view>
			<view class="mam">
				<text style="font-size: 34rpx;font-weight: 600;">{{ userStoreInfo.userInfo.supplier.storeName }}</text>
				<text>店铺ID：{{ userStoreInfo.userInfo.supplier.memberId }}</text>
			</view>
			<view class="mar">
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		<view class="bzMoney" @click="routerLink('bzMoney')">
			<text>保证金</text>
			<view class="bmr intFont r-flex-center-center">
				<text style="margin-right: 16rpx;">￥{{ zongshu }}</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
	</view>
</template>
<style lang="scss">
	page {
		background-color: #fafafa;
	}

	view {
		box-sizing: border-box;
	}

	.container {
		width: 686rpx;
		padding: 0 30rpx;
		background: #FFFFFF;
		box-shadow: 8rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 24rpx;
		border: 2rpx solid #FFFFFF;
		margin: 30rpx auto 0;

		.maTop {
			width: 100%;
			// height: 150rpx;
			margin: 0rpx auto 0rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1rpx solid #e7e7e7;
			padding: 30rpx 0;

			.mal {
				image {
					width: 120rpx;
					height: 120rpx;
					border-radius: 70rpx;
				}
			}

			.mam {
				width: 430rpx;
				height: 90rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				align-items: flex-start;

				text:nth-child(2) {
					font-size: 26rpx;
					color: #909399;
				}
			}

			.mar {
				height: 90rpx;
				display: flex;
				align-items: center;
			}
		}

		.bzMoney {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx 0;
			font-weight: 600;

			.bmr {
				color: #909399;
				line-height: 30rpx;
			}
		}
	}
</style>